home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / JManager.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  29.5 KB  |  950 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        JManager.a
  3. ;
  4. ;    Contains:    Routines that can be used to invoke the Java Virtual Machine in MRJ 
  5. ;
  6. ;    Version:    Technology:    MRJ 2.0
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1996-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__JMANAGER__') = 'UNDEFINED' THEN
  19. __JMANAGER__ SET 1
  20.  
  21.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  22.     include 'ConditionalMacros.a'
  23.     ENDIF
  24.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  25.     include 'MacTypes.a'
  26.     ENDIF
  27.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  28.     include 'Files.a'
  29.     ENDIF
  30.     IF &TYPE('__DRAG__') = 'UNDEFINED' THEN
  31.     include 'Drag.a'
  32.     ENDIF
  33.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  34.     include 'Quickdraw.a'
  35.     ENDIF
  36.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  37.     include 'Menus.a'
  38.     ENDIF
  39.     IF &TYPE('__TEXTCOMMON__') = 'UNDEFINED' THEN
  40.     include 'TextCommon.a'
  41.     ENDIF
  42.  
  43.  
  44.  
  45. kJMVersion                        EQU        $11000003            ; using Sun's 1.1 APIs, our current APIs. 
  46. kDefaultJMTime                    EQU        $00000400            ; how much time to give the JM library on "empty" events, in milliseconds. 
  47.  
  48. kJMVersionError                    EQU        -60000
  49. kJMExceptionOccurred            EQU        -60001
  50. kJMBadClassPathError            EQU        -60002
  51. ; *    Private data structures
  52. ; *
  53. ; *    JMClientData        - enough bits to reliably store a pointer to arbitrary, client-specific data. 
  54. ; *    JMSessionRef        - references the entire java runtime 
  55. ; *    JMTextRef            - a Text string, length, and encoding 
  56. ; *    JMTextEncoding        - which encoding to use when converting in and out of Java strings.
  57. ; *    JMFrameRef            - a java frame 
  58. ; *    JMAWTContextRef     - a context for the AWT to request frames, process events 
  59. ; *    JMAppletLocatorRef    - a device for locating, fetching, and parsing URLs that may contain applets 
  60. ; *    JMAppletViewerRef    - an object that displays applets in a Frame 
  61.  
  62. ; typedef void *                        JMClientData
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76. ; typedef TextEncoding                     JMTextEncoding
  77.  
  78.  
  79. ; * The runtime requires certain callbacks be used to communicate between
  80. ; * session events and the embedding application.
  81. ; *
  82. ; * In general, you can pass nil as a callback and a "good" default will be used.
  83. ; *
  84. ; *    JMConsoleProcPtr          - redirect stderr or stdout - the message is delivered in the encoding specified when
  85. ; *                                you created the session, or possibly binary data.
  86. ; *    JMConsoleReadProcPtr     - take input from the user from a console or file.  The input is expected to 
  87. ; *                                be in the encoding specified when you opened the session.
  88. ; *    JMExitProcPtr              - called via System.exit(int), return "true" to kill the current thread,
  89. ; *                                false, to cause a 'QUIT' AppleEvent to be sent to the current process,
  90. ; *                                or just tear down the runtime and exit to shell immediately
  91. ; * JMLowMemoryProcPtr          - This callback is available to notify the embedding application that
  92. ; *                                a low memory situation has occurred so it can attempt to recover appropriately.
  93. ; * JMAuthenicateURLProcPtr  - prompt the user for autentication based on the URL.  If you pass
  94. ; *                                nil, JManager will prompt the user.  Return false if the user pressed cancel.
  95.  
  96. JMSessionCallbacks        RECORD 0
  97. fVersion                 ds.l    1                ; offset: $0 (0)        ;  should be set to kJMVersion 
  98. fStandardOutput             ds.l    1                ; offset: $4 (4)        ;  JM will route "stdout" to this function. 
  99. fStandardError             ds.l    1                ; offset: $8 (8)        ;  JM will route "stderr" to this function. 
  100. fStandardIn                 ds.l    1                ; offset: $C (12)        ;  read from console - can be nil for default behavior (no console IO) 
  101. fExitProc                 ds.l    1                ; offset: $10 (16)        ;  handle System.exit(int) requests 
  102. fAuthenticateProc         ds.l    1                ; offset: $14 (20)        ;  present basic authentication dialog 
  103. fLowMemProc                 ds.l    1                ; offset: $18 (24)        ;  Low Memory notification Proc 
  104. sizeof                     EQU *                    ; size:   $1C (28)
  105.                         ENDR
  106.  
  107. ; typedef long                            JMVerifierOptions
  108. eDontCheckCode                    EQU        0
  109. eCheckRemoteCode                EQU        1
  110. eCheckAllCode                    EQU        2
  111.  
  112. ; * JMRuntimeOptions is a mask that allows you to specify certain attributes
  113. ; * for the runtime. Bitwise or the fields together, or use one of the "premade" entries.
  114. ; * eJManager2Defaults is the factory default, and best bet to use.
  115.  
  116.  
  117. ; typedef long                            JMRuntimeOptions
  118. eJManager2Defaults                EQU        0
  119. eUseAppHeapOnly                    EQU        $01
  120. eDisableJITC                    EQU        $02
  121. eEnableDebugger                    EQU        $04
  122. eDisableInternetConfig            EQU        $08
  123. eInhibitClassUnloading            EQU        $10
  124. eEnableProfiling                EQU        $20
  125. eJManager1Compatible            EQU        $18
  126.  
  127.  
  128.  
  129. ; * Returns the version of the currently installed JManager library.
  130. ; * Compare to kJMVersion.  This is the only call that doesn't
  131. ; * require a session, or a reference to something that references
  132. ; * a session.
  133.  
  134. ;
  135. ; extern unsigned long JMGetVersion(void)
  136. ;
  137.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  138.         IMPORT_CFM_FUNCTION JMGetVersion
  139.     ENDIF
  140.  
  141. ; * JMOpenSession creates a new Java Runtime.  Note that JManger 2.0 doesn't set 
  142. ; * security options at the time of runtime instantiation.  AppletViewer Objecs have
  143. ; * seperate security attributes bound to them, and the verifier is availiable elsewhere
  144. ; * as well.  The client data parameter lets a client associate an arbitgrary tagged pointer
  145. ; * with the seession.
  146. ; * When you create the session, you must specify the desired Text Encoding to use for
  147. ; * console IO.  Usually, its OK to use "kTextEncodingMacRoman".  See TextCommon.h for the list.
  148.  
  149. ;
  150. ; extern OSStatus JMOpenSession(JMSessionRef *session, JMRuntimeOptions runtimeOptions, JMVerifierOptions verifyMode, const JMSessionCallbacks *callbacks, JMTextEncoding desiredEncoding, JMClientData data)
  151. ;
  152.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  153.         IMPORT_CFM_FUNCTION JMOpenSession
  154.     ENDIF
  155.  
  156. ;
  157. ; extern OSStatus JMCloseSession(JMSessionRef session)
  158. ;
  159.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  160.         IMPORT_CFM_FUNCTION JMCloseSession
  161.     ENDIF
  162.  
  163.  
  164. ; * Client data getter/setter functions.
  165.  
  166. ;
  167. ; extern OSStatus JMGetSessionData(JMSessionRef session, JMClientData *data)
  168. ;
  169.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  170.         IMPORT_CFM_FUNCTION JMGetSessionData
  171.     ENDIF
  172.  
  173. ;
  174. ; extern OSStatus JMSetSessionData(JMSessionRef session, JMClientData data)
  175. ;
  176.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  177.         IMPORT_CFM_FUNCTION JMSetSessionData
  178.     ENDIF
  179.  
  180.  
  181. ; * Prepend the target of the FSSpec to the class path.
  182. ; * If a file, .zip or other known archive file - not a .class file
  183.  
  184. ;
  185. ; extern OSStatus JMAddToClassPath(JMSessionRef session, const FSSpec *spec)
  186. ;
  187.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  188.         IMPORT_CFM_FUNCTION JMAddToClassPath
  189.     ENDIF
  190.  
  191.  
  192. ; * Utility returns (client owned) null terminated handle containing "file://xxxx", or nil if fnfErr
  193.  
  194. ;
  195. ; extern Handle JMFSSToURL(JMSessionRef session, const FSSpec *spec)
  196. ;
  197.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  198.         IMPORT_CFM_FUNCTION JMFSSToURL
  199.     ENDIF
  200.  
  201.  
  202. ; * Turns "file:///disk/file" into an FSSpec.  other handlers return paramErr
  203.  
  204. ;
  205. ; extern OSStatus JMURLToFSS(JMSessionRef session, const char *urlString, FSSpec *spec)
  206. ;
  207.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  208.         IMPORT_CFM_FUNCTION JMURLToFSS
  209.     ENDIF
  210.  
  211.  
  212. ; * JMIdle gives time to all Java threads. Giving more time makes Java programs run faster,
  213. ; * but can reduce overall system responsiveness. JMIdle will return sooner if low-level (user)
  214. ; * events appear in the event queue.
  215.  
  216. ;
  217. ; extern OSStatus JMIdle(JMSessionRef session, UInt32 jmTimeMillis)
  218. ;
  219.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  220.         IMPORT_CFM_FUNCTION JMIdle
  221.     ENDIF
  222.  
  223.  
  224. ; * Java defines system-wide properties that applets can use to make queries about the
  225. ; * host system. Many of these properties correspond to defaults provided by "Internet Config."
  226. ; * JMPutSessionProperty can be used by a client program to modify various system-wide properties.
  227.  
  228. ;
  229. ; extern OSStatus JMGetSessionProperty(JMSessionRef session, JMTextRef propertyName, JMTextRef *propertyValue)
  230. ;
  231.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  232.         IMPORT_CFM_FUNCTION JMGetSessionProperty
  233.     ENDIF
  234.  
  235. ;
  236. ; extern OSStatus JMPutSessionProperty(JMSessionRef session, JMTextRef propertyName, JMTextRef propertyValue)
  237. ;
  238.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  239.         IMPORT_CFM_FUNCTION JMPutSessionProperty
  240.     ENDIF
  241.  
  242.  
  243. ; * JMText: opaque object that encapsulates a string, length, and
  244. ; * character encoding.  Strings passed between JManager and the
  245. ; * embedding application goes through this interface.  Only the most
  246. ; * rudimentary conversion routines are supplied - it is expected that
  247. ; * the embedding application will most of its work in the System Script.
  248. ; *
  249. ; * These APIs present some questions about who actually owns the 
  250. ; * JMText.  The rule is, if you created a JMTextRef, you are responsible
  251. ; * for deleting it after passing it into the runtime.  If the runtime passes
  252. ; * one to you, it will be deleted after the callback.
  253. ; *
  254. ; * If a pointer to an uninitialised JMTextRef is passed in to a routine (eg JMGetSessionProperty),
  255. ; * it is assumed to have been created for the caller, and it is the callers responsibility to
  256. ; * dispose of it.
  257. ; *
  258. ; * The encoding types are taken verbatim from the Text Encoding Converter,
  259. ; * which handles the ugly backside of script conversion.
  260.  
  261. ; * JMNewTextRef can create from a buffer of data in the specified encoding
  262.  
  263. ;
  264. ; extern OSStatus JMNewTextRef(JMSessionRef session, JMTextRef *textRef, JMTextEncoding encoding, const void *charBuffer, UInt32 bufferLengthInBytes)
  265. ;
  266.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  267.         IMPORT_CFM_FUNCTION JMNewTextRef
  268.     ENDIF
  269.  
  270.  
  271. ; * JMCopyTextRef clones a text ref.
  272.  
  273. ;
  274. ; extern OSStatus JMCopyTextRef(JMTextRef textRefSrc, JMTextRef *textRefDst)
  275. ;
  276.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  277.         IMPORT_CFM_FUNCTION JMCopyTextRef
  278.     ENDIF
  279.  
  280.  
  281. ; * Disposes of a text ref passed back from the runtime, or created explicitly through JMNewTextRef
  282.  
  283. ;
  284. ; extern OSStatus JMDisposeTextRef(JMTextRef textRef)
  285. ;
  286.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  287.         IMPORT_CFM_FUNCTION JMDisposeTextRef
  288.     ENDIF
  289.  
  290.  
  291. ; * Returns the text length, in characters
  292.  
  293. ;
  294. ; extern OSStatus JMGetTextLength(JMTextRef textRef, UInt32 *textLengthInCharacters)
  295. ;
  296.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  297.         IMPORT_CFM_FUNCTION JMGetTextLength
  298.     ENDIF
  299.  
  300.  
  301. ; * Returns the text length, in number of bytes taken in the destination encoding
  302.  
  303. ;
  304. ; extern OSStatus JMGetTextLengthInBytes(JMTextRef textRef, JMTextEncoding dstEncoding, UInt32 *textLengthInBytes)
  305. ;
  306.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  307.         IMPORT_CFM_FUNCTION JMGetTextLengthInBytes
  308.     ENDIF
  309.  
  310.  
  311. ; * Copies the specified number of characters to the destination buffer with the appropriate
  312. ; * destination encoding.
  313.  
  314. ;
  315. ; extern OSStatus JMGetTextBytes(JMTextRef textRef, JMTextEncoding dstEncoding, void *textBuffer, UInt32 textBufferLength, UInt32 *numCharsCopied)
  316. ;
  317.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  318.         IMPORT_CFM_FUNCTION JMGetTextBytes
  319.     ENDIF
  320.  
  321.  
  322. ; * Returns a Handle to a null terminated, "C" string in the System Script.
  323.  
  324. ;
  325. ; extern Handle JMTextToMacOSCStringHandle(JMTextRef textRef)
  326. ;
  327.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  328.         IMPORT_CFM_FUNCTION JMTextToMacOSCStringHandle
  329.     ENDIF
  330.  
  331.  
  332.  
  333.  
  334. ; * Proxy properties in the runtime.
  335. ; *
  336. ; * These will only be checked if InternetConfig isn't used to specify properties,
  337. ; * or if it doesn't have the data for these.
  338.  
  339. JMProxyInfo                RECORD 0
  340. useProxy                 ds.b    1                ; offset: $0 (0)
  341. proxyHost                 ds.b    255                ; offset: $1 (1)
  342. proxyPort                 ds.w    1                ; offset: $100 (256)
  343. sizeof                     EQU *                    ; size:   $102 (258)
  344.                         ENDR
  345.  
  346. ; typedef long                            JMProxyType
  347. eHTTPProxy                        EQU        0
  348. eFirewallProxy                    EQU        1
  349. eFTPProxy                        EQU        2
  350. ;
  351. ; extern OSStatus JMGetProxyInfo(JMSessionRef session, JMProxyType proxyType, JMProxyInfo *proxyInfo)
  352. ;
  353.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  354.         IMPORT_CFM_FUNCTION JMGetProxyInfo
  355.     ENDIF
  356.  
  357. ;
  358. ; extern OSStatus JMSetProxyInfo(JMSessionRef session, JMProxyType proxyType, const JMProxyInfo *proxyInfo)
  359. ;
  360.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  361.         IMPORT_CFM_FUNCTION JMSetProxyInfo
  362.     ENDIF
  363.  
  364.  
  365. ; * Security - JManager 2.0 security is handled on a per-applet basis.
  366. ; * There are some security settings that are inherited from InternetConfig
  367. ; * (Proxy Servers) but the verifier can now be enabled and disabled.
  368.  
  369. ;
  370. ; extern OSStatus JMGetVerifyMode(JMSessionRef session, JMVerifierOptions *verifierOptions)
  371. ;
  372.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  373.         IMPORT_CFM_FUNCTION JMGetVerifyMode
  374.     ENDIF
  375.  
  376. ;
  377. ; extern OSStatus JMSetVerifyMode(JMSessionRef session, JMVerifierOptions verifierOptions)
  378. ;
  379.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  380.         IMPORT_CFM_FUNCTION JMSetVerifyMode
  381.     ENDIF
  382.  
  383.  
  384.  
  385.  
  386. ; * The basic unit of AWT interaction is the JMFrame.  A JMFrame is bound to top level
  387. ; * awt Frame, Window, or Dialog.  When a user event occurs for a MacOS window, the event is passed
  388. ; * to the corrosponding frame object.  Similarly, when an AWT event occurs that requires the
  389. ; * Mac OS Window to change, a callback is made.  JManager 1.x bound the frame to the window through
  390. ; * a callback to set and restore the windows GrafPort.  In JManager 2.0, a GrafPort, Offset, and 
  391. ; * ClipRgn are specified up front - changes in visibility and structure require that these be re-set.
  392. ; * This enables support for the JavaSoft DrawingSurface API - and also improves graphics performance.
  393. ; * You should reset the graphics attributes anytime the visiblity changes, like when scrolling.
  394. ; * You should also set it initially when the AWTContext requests the frame.
  395. ; * At various times, JM will call back to the client to register a new JMFrame, 
  396. ; * indicating the frame type.  The client should take the following steps:
  397. ; *
  398. ; *    o    Create a new invisible window of the specified type
  399. ; *    o    Fill in the callbacks parameter with function pointers
  400. ; *    o    Do something to bind the frame to the window (like stuff the WindowPtr in the JMClientData of the frame)
  401. ; *    o    Register the visiblity parameters (GrafPtr, etc) with the frame
  402.  
  403.  
  404. ; typedef long                            ReorderRequest
  405. eBringToFront                    EQU        0                    ; bring the window to front 
  406. eSendToBack                        EQU        1                    ; send the window to back 
  407. eSendBehindFront                EQU        2                    ; send the window behind the front window 
  408. JMFrameCallbacks        RECORD 0
  409. fVersion                 ds.l    1                ; offset: $0 (0)        ;  should be set to kJMVersion 
  410. fSetFrameSize             ds.l    1                ; offset: $4 (4)
  411. fInvalRect                 ds.l    1                ; offset: $8 (8)
  412. fShowHide                 ds.l    1                ; offset: $C (12)
  413. fSetTitle                 ds.l    1                ; offset: $10 (16)
  414. fCheckUpdate             ds.l    1                ; offset: $14 (20)
  415. fReorderFrame             ds.l    1                ; offset: $18 (24)
  416. fSetResizeable             ds.l    1                ; offset: $1C (28)
  417. sizeof                     EQU *                    ; size:   $20 (32)
  418.                         ENDR
  419. ;
  420. ; extern OSStatus JMSetFrameVisibility(JMFrameRef frame, GrafPtr famePort, Point frameOrigin, RgnHandle frameClip)
  421. ;
  422.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  423.         IMPORT_CFM_FUNCTION JMSetFrameVisibility
  424.     ENDIF
  425.  
  426. ;
  427. ; extern OSStatus JMGetFrameData(JMFrameRef frame, JMClientData *data)
  428. ;
  429.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  430.         IMPORT_CFM_FUNCTION JMGetFrameData
  431.     ENDIF
  432.  
  433. ;
  434. ; extern OSStatus JMSetFrameData(JMFrameRef frame, JMClientData data)
  435. ;
  436.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  437.         IMPORT_CFM_FUNCTION JMSetFrameData
  438.     ENDIF
  439.  
  440. ;
  441. ; extern OSStatus JMGetFrameSize(JMFrameRef frame, Rect *result)
  442. ;
  443.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  444.         IMPORT_CFM_FUNCTION JMGetFrameSize
  445.     ENDIF
  446.  
  447. ;  note that the top left indicates the "global" position of this frame 
  448. ;  use this to update the frame position when it gets moved 
  449. ;
  450. ; extern OSStatus JMSetFrameSize(JMFrameRef frame, const Rect *newSize)
  451. ;
  452.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  453.         IMPORT_CFM_FUNCTION JMSetFrameSize
  454.     ENDIF
  455.  
  456. ; * Dispatch a particular event to an embedded frame
  457.  
  458. ;
  459. ; extern OSStatus JMFrameClick(JMFrameRef frame, Point localPos, short modifiers)
  460. ;
  461.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  462.         IMPORT_CFM_FUNCTION JMFrameClick
  463.     ENDIF
  464.  
  465. ;
  466. ; extern OSStatus JMFrameKey(JMFrameRef frame, char asciiChar, char keyCode, short modifiers)
  467. ;
  468.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  469.         IMPORT_CFM_FUNCTION JMFrameKey
  470.     ENDIF
  471.  
  472. ;
  473. ; extern OSStatus JMFrameKeyRelease(JMFrameRef frame, char asciiChar, char keyCode, short modifiers)
  474. ;
  475.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  476.         IMPORT_CFM_FUNCTION JMFrameKeyRelease
  477.     ENDIF
  478.  
  479. ;
  480. ; extern OSStatus JMFrameUpdate(JMFrameRef frame, RgnHandle updateRgn)
  481. ;
  482.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  483.         IMPORT_CFM_FUNCTION JMFrameUpdate
  484.     ENDIF
  485.  
  486. ;
  487. ; extern OSStatus JMFrameActivate(JMFrameRef frame, Boolean activate)
  488. ;
  489.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  490.         IMPORT_CFM_FUNCTION JMFrameActivate
  491.     ENDIF
  492.  
  493. ;
  494. ; extern OSStatus JMFrameResume(JMFrameRef frame, Boolean resume)
  495. ;
  496.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  497.         IMPORT_CFM_FUNCTION JMFrameResume
  498.     ENDIF
  499.  
  500. ;
  501. ; extern OSStatus JMFrameMouseOver(JMFrameRef frame, Point localPos, short modifiers)
  502. ;
  503.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  504.         IMPORT_CFM_FUNCTION JMFrameMouseOver
  505.     ENDIF
  506.  
  507. ;
  508. ; extern OSStatus JMFrameShowHide(JMFrameRef frame, Boolean showFrame)
  509. ;
  510.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  511.         IMPORT_CFM_FUNCTION JMFrameShowHide
  512.     ENDIF
  513.  
  514. ;
  515. ; extern OSStatus JMFrameGoAway(JMFrameRef frame)
  516. ;
  517.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  518.         IMPORT_CFM_FUNCTION JMFrameGoAway
  519.     ENDIF
  520.  
  521. ;
  522. ; extern JMAWTContextRef JMGetFrameContext(JMFrameRef frame)
  523. ;
  524.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  525.         IMPORT_CFM_FUNCTION JMGetFrameContext
  526.     ENDIF
  527.  
  528. ;
  529. ; extern OSStatus JMFrameDragTracking(JMFrameRef frame, DragTrackingMessage message, DragReference theDragRef)
  530. ;
  531.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  532.         IMPORT_CFM_FUNCTION JMFrameDragTracking
  533.     ENDIF
  534.  
  535. ;
  536. ; extern OSStatus JMFrameDragReceive(JMFrameRef frame, DragReference theDragRef)
  537. ;
  538.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  539.         IMPORT_CFM_FUNCTION JMFrameDragReceive
  540.     ENDIF
  541.  
  542. ; * Window types
  543.  
  544.  
  545. ; typedef long                            JMFrameKind
  546. eBorderlessModelessWindowFrame    EQU        0
  547. eModelessWindowFrame            EQU        1
  548. eModalWindowFrame                EQU        2
  549. eModelessDialogFrame            EQU        3
  550.  
  551.  
  552.  
  553. ;  JMAWTContext -
  554. ; * To create a top level frame, you must use a JMAWTContext object.
  555. ; * The JMAWTContext provides a context for the AWT to request frames.
  556. ; * A AWTContext has a threadgroup associated with it - all events and processing occurs
  557. ; * there.  When you create one, it is quiescent, you must call resume before it begins executing.
  558.  
  559. JMAWTContextCallbacks    RECORD 0
  560. fVersion                 ds.l    1                ; offset: $0 (0)        ;  should be set to kJMVersion 
  561. fRequestFrame             ds.l    1                ; offset: $4 (4)        ;  a new frame is being created. 
  562. fReleaseFrame             ds.l    1                ; offset: $8 (8)        ;  an existing frame is being destroyed. 
  563. fUniqueMenuID             ds.l    1                ; offset: $C (12)        ;  a new menu will be created with this id. 
  564. fExceptionOccurred         ds.l    1                ; offset: $10 (16)        ;  just some notification that some recent operation caused an exception.  You can't do anything really from here. 
  565. sizeof                     EQU *                    ; size:   $14 (20)
  566.                         ENDR
  567. ;
  568. ; extern OSStatus JMNewAWTContext(JMAWTContextRef *context, JMSessionRef session, const JMAWTContextCallbacks *callbacks, JMClientData data)
  569. ;
  570.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  571.         IMPORT_CFM_FUNCTION JMNewAWTContext
  572.     ENDIF
  573.  
  574. ;
  575. ; extern OSStatus JMDisposeAWTContext(JMAWTContextRef context)
  576. ;
  577.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  578.         IMPORT_CFM_FUNCTION JMDisposeAWTContext
  579.     ENDIF
  580.  
  581. ;
  582. ; extern OSStatus JMGetAWTContextData(JMAWTContextRef context, JMClientData *data)
  583. ;
  584.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  585.         IMPORT_CFM_FUNCTION JMGetAWTContextData
  586.     ENDIF
  587.  
  588. ;
  589. ; extern OSStatus JMSetAWTContextData(JMAWTContextRef context, JMClientData data)
  590. ;
  591.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  592.         IMPORT_CFM_FUNCTION JMSetAWTContextData
  593.     ENDIF
  594.  
  595. ;
  596. ; extern OSStatus JMCountAWTContextFrames(JMAWTContextRef context, UInt32 *frameCount)
  597. ;
  598.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  599.         IMPORT_CFM_FUNCTION JMCountAWTContextFrames
  600.     ENDIF
  601.  
  602. ;
  603. ; extern OSStatus JMGetAWTContextFrame(JMAWTContextRef context, UInt32 frameIndex, JMFrameRef *frame)
  604. ;
  605.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  606.         IMPORT_CFM_FUNCTION JMGetAWTContextFrame
  607.     ENDIF
  608.  
  609. ;
  610. ; extern OSStatus JMMenuSelected(JMAWTContextRef context, MenuHandle hMenu, short menuItem)
  611. ;
  612.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  613.         IMPORT_CFM_FUNCTION JMMenuSelected
  614.     ENDIF
  615.  
  616.  
  617.  
  618.  
  619. ; *
  620. ; * JMAppletLocator - Since Java applets are always referenced by a Uniform Resource Locator
  621. ; * (see RFC 1737, http://www.w3.org/pub/WWW/Addressing/rfc1738.txt), we provide an object
  622. ; * that encapsulates the information about a set of applets. A JMAppletLocator is built
  623. ; * by providing a base URL, which must point at a valid HTML document containing applet
  624. ; * tags. To save a network transaction, the contents of the document may be passed optionally. 
  625. ; *
  626. ; * You can also use a JMLocatorInfoBlock for a synchronous resolution of the applet,
  627. ; * assuming that you already have the info for the tag.
  628.  
  629.  
  630. ; typedef long                            JMLocatorErrors
  631. eLocatorNoErr                    EQU        0                    ; the html was retrieved successfully
  632. eHostNotFound                    EQU        1                    ; the host specified by the url could not be found
  633. eFileNotFound                    EQU        2                    ; the file could not be found on the host
  634. eLocatorTimeout                    EQU        3                    ; a timeout occurred retrieving the html text
  635. eLocatorKilled                    EQU        4                    ; in response to a JMDisposeAppletLocator before it has completed
  636. JMAppletLocatorCallbacks RECORD 0
  637. fVersion                 ds.l    1                ; offset: $0 (0)        ;  should be set to kJMVersion 
  638. fCompleted                 ds.l    1                ; offset: $4 (4)        ;  called when the html has been completely fetched 
  639. sizeof                     EQU *                    ; size:   $8 (8)
  640.                         ENDR
  641. ; * These structures are used to pass pre-parsed parameter
  642. ; * tags to the AppletLocator.  Implies synchronous semantics.
  643.  
  644.  
  645. JMLIBOptionalParams        RECORD 0
  646. fParamName                 ds.l    1                ; offset: $0 (0)        ;  could be from a <parameter name=foo value=bar> or "zipbase", etc 
  647. fParamValue                 ds.l    1                ; offset: $4 (4)        ;  the value of this optional tag 
  648. sizeof                     EQU *                    ; size:   $8 (8)
  649.                         ENDR
  650. JMLocatorInfoBlock        RECORD 0
  651. fVersion                 ds.l    1                ; offset: $0 (0)        ;  should be set to kJMVersion 
  652. ;  These are required to be present and not nil 
  653. fBaseURL                 ds.l    1                ; offset: $4 (4)        ;  the URL of this applet's host page 
  654. fAppletCode                 ds.l    1                ; offset: $8 (8)        ;  code= parameter 
  655. fWidth                     ds.w    1                ; offset: $C (12)        ;  width= parameter 
  656. fHeight                     ds.w    1                ; offset: $E (14)        ;  height= parameter 
  657. ;  These are optional parameters 
  658. fOptionalParameterCount     ds.l    1                ; offset: $10 (16)        ;  how many in this array 
  659. fParams                     ds.l    1                ; offset: $14 (20)        ;  pointer to an array of these (points to first element) 
  660. sizeof                     EQU *                    ; size:   $18 (24)
  661.                         ENDR
  662. ;
  663. ; extern OSStatus JMNewAppletLocator(JMAppletLocatorRef *locatorRef, JMSessionRef session, const JMAppletLocatorCallbacks *callbacks, JMTextRef url, JMTextRef htmlText, JMClientData data)
  664. ;
  665.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  666.         IMPORT_CFM_FUNCTION JMNewAppletLocator
  667.     ENDIF
  668.  
  669. ;
  670. ; extern OSStatus JMNewAppletLocatorFromInfo(JMAppletLocatorRef *locatorRef, JMSessionRef session, const JMLocatorInfoBlock *info, JMClientData data)
  671. ;
  672.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  673.         IMPORT_CFM_FUNCTION JMNewAppletLocatorFromInfo
  674.     ENDIF
  675.  
  676. ;
  677. ; extern OSStatus JMDisposeAppletLocator(JMAppletLocatorRef locatorRef)
  678. ;
  679.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  680.         IMPORT_CFM_FUNCTION JMDisposeAppletLocator
  681.     ENDIF
  682.  
  683. ;
  684. ; extern OSStatus JMGetAppletLocatorData(JMAppletLocatorRef locatorRef, JMClientData *data)
  685. ;
  686.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  687.         IMPORT_CFM_FUNCTION JMGetAppletLocatorData
  688.     ENDIF
  689.  
  690. ;
  691. ; extern OSStatus JMSetAppletLocatorData(JMAppletLocatorRef locatorRef, JMClientData data)
  692. ;
  693.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  694.         IMPORT_CFM_FUNCTION JMSetAppletLocatorData
  695.     ENDIF
  696.  
  697. ;
  698. ; extern OSStatus JMCountApplets(JMAppletLocatorRef locatorRef, UInt32 *appletCount)
  699. ;
  700.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  701.         IMPORT_CFM_FUNCTION JMCountApplets
  702.     ENDIF
  703.  
  704. ;
  705. ; extern OSStatus JMGetAppletDimensions(JMAppletLocatorRef locatorRef, UInt32 appletIndex, UInt32 *width, UInt32 *height)
  706. ;
  707.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  708.         IMPORT_CFM_FUNCTION JMGetAppletDimensions
  709.     ENDIF
  710.  
  711. ;
  712. ; extern OSStatus JMGetAppletTag(JMAppletLocatorRef locatorRef, UInt32 appletIndex, JMTextRef *tagRef)
  713. ;
  714.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  715.         IMPORT_CFM_FUNCTION JMGetAppletTag
  716.     ENDIF
  717.  
  718. ;
  719. ; extern OSStatus JMGetAppletName(JMAppletLocatorRef locatorRef, UInt32 appletIndex, JMTextRef *nameRef)
  720. ;
  721.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  722.         IMPORT_CFM_FUNCTION JMGetAppletName
  723.     ENDIF
  724.  
  725.  
  726. ; * JMAppletViewer - Applets are instantiated, one by one, by specifying a JMAppletLocator and
  727. ; * a zero-based index (Macintosh API's usually use one-based indexing, the Java language
  728. ; * uses zero, however.). The resulting applet is encapsulated in a JMAppletViewer object. 
  729. ; * Since applets can have one or more visible areas to draw in, one or more JMFrame objects
  730. ; * may be requested while the viewer is being created, or at a later time, thus the client
  731. ; * must provide callbacks to satisfy these requests.
  732. ; *
  733. ; * The window name for the ShowDocument callback is one of:
  734. ; *   _self        show in current frame
  735. ; *   _parent    show in parent frame
  736. ; *   _top        show in top-most frame
  737. ; *   _blank        show in new unnamed top-level window
  738. ; *   <other>    show in new top-level window named <other> 
  739.  
  740. JMAppletViewerCallbacks    RECORD 0
  741. fVersion                 ds.l    1                ; offset: $0 (0)        ;  should be set to kJMVersion 
  742. fShowDocument             ds.l    1                ; offset: $4 (4)        ;  go to a url, optionally in a new window 
  743. fSetStatusMsg             ds.l    1                ; offset: $8 (8)        ;  applet changed status message 
  744. sizeof                     EQU *                    ; size:   $C (12)
  745.                         ENDR
  746. ; * NEW: per-applet security settings
  747. ; * Previously, these settings were attached to the session.
  748. ; * JManager 2.0 allows them to be attached to each viewer.
  749.  
  750.  
  751. ; typedef long                            JMNetworkSecurityOptions
  752. eNoNetworkAccess                EQU        0
  753. eAppletHostAccess                EQU        1
  754. eUnrestrictedAccess                EQU        2
  755.  
  756. ; typedef long                            JMFileSystemOptions
  757. eNoFSAccess                        EQU        0
  758. eLocalAppletAccess                EQU        1
  759. eAllFSAccess                    EQU        2
  760. ; * Lists of packages are comma separated,
  761. ; * the default for mrj.security.system.access is
  762. ; * "sun,netscape,com.apple".
  763.  
  764.  
  765. JMAppletSecurity        RECORD 0
  766. fVersion                 ds.l    1                ; offset: $0 (0)        ;  should be set to kJMVersion 
  767. fNetworkSecurity         ds.l    1                ; offset: $4 (4)        ;  can this applet access network resources 
  768. fFileSystemSecurity         ds.l    1                ; offset: $8 (8)        ;  can this applet access network resources 
  769. fRestrictSystemAccess     ds.b    1                ; offset: $C (12)        ;  restrict access to system packages (com.apple.*, sun.*, netscape.*) also found in the property "mrj.security.system.access" 
  770. fRestrictSystemDefine     ds.b    1                ; offset: $D (13)        ;  restrict classes from loading system packages (com.apple.*, sun.*, netscape.*) also found in the property "mrj.security.system.define" 
  771. fRestrictApplicationAccess  ds.b 1                ; offset: $E (14)        ;  restrict access to application packages found in the property "mrj.security.application.access" 
  772. fRestrictApplicationDefine  ds.b 1                ; offset: $F (15)        ;  restrict access to application packages found in the property "mrj.security.application.access" 
  773. sizeof                     EQU *                    ; size:   $10 (16)
  774.                         ENDR
  775. ; * AppletViewer methods
  776.  
  777. ;
  778. ; extern OSStatus JMNewAppletViewer(JMAppletViewerRef *viewer, JMAWTContextRef context, JMAppletLocatorRef locatorRef, UInt32 appletIndex, const JMAppletSecurity *security, const JMAppletViewerCallbacks *callbacks, JMClientData data)
  779. ;
  780.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  781.         IMPORT_CFM_FUNCTION JMNewAppletViewer
  782.     ENDIF
  783.  
  784. ;
  785. ; extern OSStatus JMDisposeAppletViewer(JMAppletViewerRef viewer)
  786. ;
  787.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  788.         IMPORT_CFM_FUNCTION JMDisposeAppletViewer
  789.     ENDIF
  790.  
  791. ;
  792. ; extern OSStatus JMGetAppletViewerData(JMAppletViewerRef viewer, JMClientData *data)
  793. ;
  794.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  795.         IMPORT_CFM_FUNCTION JMGetAppletViewerData
  796.     ENDIF
  797.  
  798. ;
  799. ; extern OSStatus JMSetAppletViewerData(JMAppletViewerRef viewer, JMClientData data)
  800. ;
  801.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  802.         IMPORT_CFM_FUNCTION JMSetAppletViewerData
  803.     ENDIF
  804.  
  805.  
  806. ; * You can change the applet security on the fly
  807.  
  808. ;
  809. ; extern OSStatus JMGetAppletViewerSecurity(JMAppletViewerRef viewer, JMAppletSecurity *data)
  810. ;
  811.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  812.         IMPORT_CFM_FUNCTION JMGetAppletViewerSecurity
  813.     ENDIF
  814.  
  815. ;
  816. ; extern OSStatus JMSetAppletViewerSecurity(JMAppletViewerRef viewer, const JMAppletSecurity *data)
  817. ;
  818.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  819.         IMPORT_CFM_FUNCTION JMSetAppletViewerSecurity
  820.     ENDIF
  821.  
  822.  
  823. ; * JMReloadApplet reloads viewer's applet from the source.
  824. ; * JMRestartApplet reinstantiates the applet without reloading.
  825.  
  826. ;
  827. ; extern OSStatus JMReloadApplet(JMAppletViewerRef viewer)
  828. ;
  829.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  830.         IMPORT_CFM_FUNCTION JMReloadApplet
  831.     ENDIF
  832.  
  833. ;
  834. ; extern OSStatus JMRestartApplet(JMAppletViewerRef viewer)
  835. ;
  836.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  837.         IMPORT_CFM_FUNCTION JMRestartApplet
  838.     ENDIF
  839.  
  840.  
  841. ; * JMSuspendApplet tells the Java thread scheduler to stop executing the viewer's applet.
  842. ; * JMResumeApplet resumes execution of the viewer's applet.
  843.  
  844. ;
  845. ; extern OSStatus JMSuspendApplet(JMAppletViewerRef viewer)
  846. ;
  847.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  848.         IMPORT_CFM_FUNCTION JMSuspendApplet
  849.     ENDIF
  850.  
  851. ;
  852. ; extern OSStatus JMResumeApplet(JMAppletViewerRef viewer)
  853. ;
  854.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  855.         IMPORT_CFM_FUNCTION JMResumeApplet
  856.     ENDIF
  857.  
  858.  
  859. ;  
  860. ; * To get back to the JMAppletViewerRef instance from whence a frame came,
  861. ; * as well as the ultimate frame parent (the one created _for_ the applet viewer)
  862.  
  863. ;
  864. ; extern OSStatus JMGetFrameViewer(JMFrameRef frame, JMAppletViewerRef *viewer, JMFrameRef *parentFrame)
  865. ;
  866.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  867.         IMPORT_CFM_FUNCTION JMGetFrameViewer
  868.     ENDIF
  869.  
  870. ; * To get a ref back to the Frame that was created for this JMAppletViewerRef
  871.  
  872. ;
  873. ; extern OSStatus JMGetViewerFrame(JMAppletViewerRef viewer, JMFrameRef *frame)
  874. ;
  875.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  876.         IMPORT_CFM_FUNCTION JMGetViewerFrame
  877.     ENDIF
  878.  
  879.     ENDIF ; __JMANAGER__ 
  880.  
  881.